import { CreateDate, Entity, MemberId, Openid, PrimaryUuid, ShopGoodId, UpdateDate, ShopCardOptionId, ShopCartType, Digdit, Money, Boolean, Uuid } from '@sker/core'

@Entity({ name: 'shop_cart' })
export class ShopCart {

    @PrimaryUuid({
        primaryKeyConstraintName: "PK_SHOP_CART_ID"
    })
    id!: string;

    @MemberId()
    member_id: string;

    @Openid()
    openid!: string;

    @ShopGoodId({
        label: '商品',
        comment: '对应类型的ID'
    })
    good_id: string;

    @ShopCardOptionId({ label: '商品规格', comment: '商品规格' })
    option_id: string

    @Money({ label: '单价', comment: '单价', default: 0 })
    fee!: number;

    @Digdit({ label: '数量', comment: '数量', default: 0 })
    count: number;

    @ShopCartType()
    type: string;

    @Boolean({ comment: '是否选中', default: false })
    selected: boolean;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;

    @Uuid({ nullable: true })
    company_id: string;

}